<!DOCTYPE html>
<html>
<head>
	<meta charset='utf-8'>
	<title>沙发管家</title>
	<style type="text/css">
	/* Eric Meyer's Reset CSS v2.0 - http://cssreset.com */
	html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{border:0;font-size:100%;font:inherit;vertical-align:baseline;margin:0;padding:0}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:none}table{border-collapse:collapse;border-spacing:0}
	</style>
	<link rel="stylesheet" type="text/css" href="/css/dropzone.css">
	<script type="text/javascript">
	var sf = {};
	sf.userAgent=navigator.userAgent.toLowerCase();sf.is_ios=/(iphone|ipad|ipod)/i.test(sf.userAgent)?true:false;sf.userAgent=navigator.userAgent.toLowerCase();sf.is_ios=/(iphone|ipad|ipod)/i.test(sf.userAgent)?true:false;sf.is_ipad=/(ipad)/i.test(sf.userAgent)?true:false;sf.is_firefox=sf.userAgent.indexOf("firefox")>=0?true:false;sf.is_opera=navigator.appName.indexOf("Opera")>=0?true:false;sf.is_safari=sf.userAgent.indexOf("safari")>=0?true:false;sf.is_chrome=sf.userAgent.indexOf("chrome")>=0?true:false;if(sf.is_chrome){sf.is_safari=false}sf.is_ie=navigator.appName=="Microsoft Internet Explorer"?true:false;sf.ie=(sf.userAgent.indexOf("msie")!=-1&&!sf.is_opera)&&sf.userAgent.substr(sf.userAgent.indexOf("msie")+5,3);sf.is_ipad=/(ipad)/i.test(sf.userAgent)?true:false;sf.is_firefox=sf.userAgent.indexOf("firefox")>=0?true:false;sf.is_opera=navigator.appName.indexOf("Opera")>=0?true:false;sf.is_safari=sf.userAgent.indexOf("safari")>=0?true:false;sf.is_chrome=sf.userAgent.indexOf("chrome")>=0?true:false;if(sf.is_chrome){sf.is_safari=false}sf.is_ie=navigator.appName=="Microsoft Internet Explorer"?true:false;sf.ie=(sf.userAgent.indexOf("msie")!=-1&&!sf.is_opera)&&sf.userAgent.substr(sf.userAgent.indexOf("msie")+5,3);
	</script>
	<style type="text/css">
		body {
			background-color: #eee;
		}
		.title {
			margin: auto;
			margin-top: 100px;
			width: 800px;
			height: 60px;
			position: relative;
			text-align: center;
			background: rgb(59,129,209); /* Old browsers */
			background: -moz-linear-gradient(top,  rgba(59,129,209,1) 0%, rgba(47,116,195,1) 40%, rgba(35,104,182,1) 100%); /* FF3.6+ */
			background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(59,129,209,1)), color-stop(40%,rgba(47,116,195,1)), color-stop(100%,rgba(35,104,182,1))); /* Chrome,Safari4+ */
			background: -webkit-linear-gradient(top,  rgba(59,129,209,1) 0%,rgba(47,116,195,1) 40%,rgba(35,104,182,1) 100%); /* Chrome10+,Safari5.1+ */
			background: -o-linear-gradient(top,  rgba(59,129,209,1) 0%,rgba(47,116,195,1) 40%,rgba(35,104,182,1) 100%); /* Opera 11.10+ */
			background: -ms-linear-gradient(top,  rgba(59,129,209,1) 0%,rgba(47,116,195,1) 40%,rgba(35,104,182,1) 100%); /* IE10+ */
			background: linear-gradient(to bottom,  rgba(59,129,209,1) 0%,rgba(47,116,195,1) 40%,rgba(35,104,182,1) 100%); /* W3C */
			filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3b81d1', endColorstr='#2368b6',GradientType=0 ); /* IE6-9 */

			border-bottom:5px solid #266bba;
			border-top: 5px solid #3B81D1;
			-webkit-border-top-left-radius: 10px;
			-webkit-border-top-right-radius: 10px;
			-moz-border-radius-topleft: 10px;
			-moz-border-radius-topright: 10px;
			border-top-left-radius: 10px;
			border-top-right-radius: 10px;
			-webkit-box-shadow:  1px 1px 10px 1px rgba(0, 0, 0, 0.3);
			box-shadow:  1px 1px 10px 1px rgba(0, 0, 0, 0.3);
		}
		#dropzone {
			margin: auto;
			width: 790px;
			background-color: #eee;
			border:5px solid #fdfdfd;
			border-top: 0;
			-webkit-border-bottom-right-radius: 10px;
			-webkit-border-bottom-left-radius: 10px;
			-moz-border-radius-bottomright: 10px;
			-moz-border-radius-bottomleft: 10px;
			border-bottom-right-radius: 10px;
			border-bottom-left-radius: 10px;
			-webkit-box-shadow:  1px 1px 10px 1px rgba(0, 0, 0, 0.2);
			box-shadow:  1px 1px 10px 1px rgba(0, 0, 0, 0.2);
		}
		.dropzone {
			width: 790px;
		}
		.fallback-file-wrapper {
		    width:100%;
            text-align:center;
		}
		#fallback-file {
		    display:block;
		    margin-top:50px;
		}
		.dz-browser-not-supported .fallback {
			text-align: center;
			position: absolute;
			width: 428px;
			height: 123px;
			margin-left: -214px;
			margin-top: -61.5px;
			top: 50%;
			left: 50%;
		}
		.dz-browser-not-supported .fallback .uploading {
			font-family: "Helvetica Neue", Helvetica, Arial, sans-serif, "Microsoft YaHei";
			font-size:3em;
			color:#999;
		}
	</style>
    <!--[if IE 6]>
    <style type="text/css">
    .dropzone {
        height:400px;
    }
    </style>
    <![endif]-->
</head>
<body>
	<div class="title"><img src="/images/logo.png"></div>
	<div id="dropzone">
		<form action="/?fallback=1" method="post" class="dropzone" id="shafa-dropzone" enctype="multipart/form-data">
		  <div class="fallback" id="fallback">
		  </div>
		  <div class="fallback-file-wrapper">
		  <input id="fallback-file" name="file1" type="file"/>
		  </div>
		</form>
	</div>
	<script type="text/javascript" src="/js/jquery-1.10.2.min.js"></script>
	<script type="text/javascript">
	var fallback_foo = function(){
	    $('#shafa-dropzone').attr('action', '/?fallback=1');
        $('#fallback-file').show().css('margin', '50px auto auto');
        $('#fallback').css('background-image','none');
        $('#fallback').html('<span class="uploading">远程安装APK文件</span>');
		$('#shafa-dropzone').submit(function(event) {
			if (check_file($('#fallback-file').val())) {
				$('#fallback').html('<span class="uploading">正在上传...</span>');
				$('#fallback-file').hide();
				return true;
			}
		 	alert('请上传 APK 文件');
			return false;
		});
		$('#shafa-dropzone').addClass('dz-browser-not-supported');
		$('#fallback-file').click(function() {
		    var fallback = $('#fallback');
			if (fallback.hasClass('disabled')) return false;
            fallback.addClass('disabled');
            fallback.removeClass('disabled');
		});
		$('#fallback-file').on('change', function() {
			$('#shafa-dropzone').submit();
		});
	};
	var check_file = function(filename) {
		var fileExt = filename.substring(filename.lastIndexOf("."),filename.length); //获取文件扩展名
		fileExt = fileExt.toLowerCase();
		if (fileExt != '.apk') {
			return false;
		}
		return true;
	}
    var suck_lte_ie8 = false;
	</script>
    <script type="text/javascript" src="/js/dropzone.js"></script>
    <!--[if lt IE 8]>
    <script type="text/javascript">
        suck_lte_ie8 = true;
        fallback_foo();
    </script>
    <![endif]-->
    <script type="text/javascript">
        if (!suck_lte_ie8) {
            $("#fallback-file").hide();
            $('#shafa-dropzone').attr('action', '/');
            Dropzone.options.shafaDropzone = {
              paramName: "file1", // The name that will be used to transfer the file
              maxFilesize: 4096, // MB
              dictDefaultMessage: "点击上传，或者拖拽文件到这里",
              dictFallbackMessage: "",
              dictFallbackText: "",
              dictFileTooBig: "文件太大了 ({{filesize}}MB). 允许的最大文件大小: {{maxFilesize}}MB.",
              dictInvalidFileType: "你不能上传这个类型的文件.",
              dictResponseError: "服务器响应错误，代码：{{statusCode}} .",
              dictCancelUpload: "取消上传",
              dictCancelUploadConfirmation: "你确定要取消这次上传?",
              dictRemoveFile: "移除文件",
              accept: function(file, done) {
                if (!check_file(file.name)) {
                    done("请上传 APK 文件.");
                } else { done(); }
              },
              forceFallback: false,
              fallback: fallback_foo
            };
        }
    </script>
    
</body>
</html>